<%@page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/taglib/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/taglib/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/taglib/struts-logic.tld" prefix="logic"%>
<div id="content">
	<h2>
		<bean:message key="common.start.links.inbox" />
	</h2>

	<logic:iterate name="messageForm" property="messageList" id="message"
		indexId="index">
		<logic:equal name="message" property="isRead" value="false">
			<table class="custom_table" style="width: 500px; max-width: 500px;">
				<tr>
					<td style="width: 200px; max-width: 200px;"><bean:message
							key="common.messages.discipline" /> :</td>
					<td><bean:write name="message" property="messageSubject" /></td>
				</tr>
				<tr>
					<td><bean:message key="common.messages.user_from" /> :</td>
					<td><bean:write name="message" property="userFrom.userSurname" />
						<bean:write name="message" property="userFrom.userName" />
					</td>
				</tr>
				<tr>
					<td><bean:message key="common.messages.email" /> :</td>
					<td><bean:write name="message" property="userFrom.email" />
					</td>
				</tr>
				<tr>
					<td><bean:message key="common.messages.date" /> :</td>
					<td><bean:write name="message" property="messageDate" /></td>
				</tr>
				<tr>
					<td><bean:message key="common.messages.message" /> :</td>
					<td><bean:write name="message" property="messageBody" /></td>
				</tr>
				<tr class="header_row">
					<th><html:link action="/message.do?method=answer"
							indexed="true">
							<bean:message key="common.links.answer" />
						</html:link></th>
					<th style="background-color: #ffff00; color: white;"><html:link
							action="/message.do?method=delete&status=receive" indexed="true">
							<bean:message key="common.links.delete" />
						</html:link></th>
				</tr>
			</table>
		</logic:equal>
		<logic:notEqual name="message" property="isRead" value="false">
			<table class="custom_table" style="width: 500px; max-width: 500px;">
				<tr>
					<td style="width: 200px; max-width: 200px;"><bean:message
							key="common.messages.discipline" /> :</td>
					<td><bean:write name="message" property="messageSubject" /></td>
				</tr>
				<tr>
					<td><bean:message key="common.messages.user_from" /> :</td>
					<td><bean:write name="message" property="userFrom.userSurname" />
						<bean:write name="message" property="userFrom.userName" />
					</td>
				</tr>
				<tr>
					<td><bean:message key="common.messages.email" /> :</td>
					<td><bean:write name="message" property="userFrom.email" />
					</td>
				</tr>
				<tr>
					<td><bean:message key="common.messages.date" /> :</td>
					<td><bean:write name="message" property="messageDate" /></td>
				</tr>
				<tr>
					<td><bean:message key="common.messages.message" /> :</td>
					<td><bean:write name="message" property="messageBody" /></td>
				</tr>
				<tr>
					<td><html:link action="/message.do?method=answer"
							indexed="true">
							<bean:message key="common.links.answer" />
						</html:link></td>
					<td><html:link
							action="/message.do?method=delete&status=receive" indexed="true">
							<bean:message key="common.links.delete" />
						</html:link></td>
				</tr>
			</table>
		</logic:notEqual>
		----------------------------------------------------------------------
		<br />
	</logic:iterate>
</div>